<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1,user-scalable=no">
	<title>必中老虎机</title>
	
    <script type="text/javascript" src="js/simpl-fontSize.min.js"></script>
    
    <link rel="stylesheet" href="css/simpl-public.min.css">
    <link rel="stylesheet" href="css/compound.min.css">
	
    <script type="text/javascript" src="js/slot-jquery.min.js"></script>
    <script type="text/javascript" src="js/easing.min.js"></script>

</head>
<body>
    <div class="com-main">
        <div class="title"></div>
        <ul class="coin">
            <li class="gb">
                <h3>2559</h3>
            </li>
            <li class="jd">
                <h3>2559</h3>
            </li>
        </ul>
        <div class="slots">
            <ul class="clearfix">
                <li class="fl active" data-type="gb">钢镚合成</li>
                <li class="fr" data-type="jd">金豆分解</li>
            </ul>
            <h3>50 钢镚/次</h3>
            <dl class="clearfix">
                <dd class="fl gb"></dd>
                <dd class="fl gb"></dd>
                <dd class="fl gb"></dd>
            </dl>
            <div class="play-btn" data-type="gb"></div>
            <div class="yg"></div>
            <div class="rule"></div>
        </div>
    </div>
	
</body>
</html>
<script>
    $(function () {
        //抽奖切换
        $('.com-main .slots ul li').each(function () {
            $(this).click(function () {
                if($(this).hasClass('active')){
                    return false
                }
                $(this).addClass('active').siblings().removeClass('active');
                var type=$(this).attr('data-type');
                $(".com-main .slots dl dd").attr({'class':"fl "+type});
                $('.com-main .slots .play-btn').attr('data-type',type);
                if(type==='gb'){
                   $('.com-main .slots h3').html('50 钢镚/次');
                }else if(type==='jd'){
                    $('.com-main .slots h3').html('1 金豆/次')
                }
            });
        });

        //抽奖play按钮
        $('.com-main .slots .play-btn').click(function () {
            var u = 160.4; //盒子的高度
            var random='000';//中奖随机数 ,分解金豆获取钢镚'000','111','222'，
            var _this=$(this);
            var type=$(this).attr('data-type');
            if(!_this.hasClass('active')){
                _this.addClass('active');
                $(".com-main .slots dl dd").slots(u,random,function () {
                    _this.removeClass('active'); //还有抽奖机会移除active
                    $.giftWarm("恭喜你",'合成了<span>5</span>个金豆')
                });
            }
        });
    });
</script>